package org.codeart.map.service;

import org.codeart.common.response.DirectionResponse;
import org.codeart.map.remote.MapDirectionClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class DirectionService {
    
    @Autowired
    private MapDirectionClient mapDirectionClient;

    /**
     * 根据起点和终点的经纬度获取距离和时长
     */
    public DirectionResponse driving(String depLongitude, String depLatitude, String destLongitude, String destLatitude) {
        return mapDirectionClient.direction(depLongitude, depLatitude, destLongitude, destLatitude);
    }

}
